import React from 'react';

export default function AudioPlay({ id, elem, audioSrc, onPlay, onPause }) {
    return (
        <audio
            id={id}
            ref={elem}
            preload="auto"
            controls
            autoPlay={false}
            loop
            onPlay={onPlay}
            onPause={onPause}
            style={{
                display: 'none'
            }}
        >
            <source src={audioSrc} />
            你的浏览器不支持audio标签
        </audio>
    )
}